import Vue from 'vue'
import Router from 'vue-router'
import Main from '@/components/Main'
import Mine from '@/components/mine/mine'
import SellerCenter from '@/components/mine/sellercenter'
import Home from '@/components/Home'
import OrderList from '@/components/order/orderlist'

import Account from '@/components/account/account'
import Cash from '@/components/account/cash'
import Cashsuccess from '@/components/account/cashsuccess'
import Goods from '@/components/product/goods'
import Goodsforcustomer from '@/components/product/goodsforcustomer'
import ProductInfo from '@/components/product/product_info'
import MakeOrder from '@/components/order/makeorder'
import Paysuccess from '@/components/order/paysuccess'
import OrderInfo from '@/components/order/order_info'
import OrderInfoSms from '@/components/order/order_info_sms'

import ProfitList from '@/components/profit/profitlist'
import ProfitInfo from '@/components/profit/profit_info'
import CashLogList from '@/components/account/cashloglist'
import ApplySeller from '@/components/mine/applyseller'
import FansList from '@/components/mine/fanslist'
import SellerList from '@/components/mine/sellerlist'
import Statistics from '@/components/statistics/statistics'
import StatisticsSeller from '@/components/statistics/seller'
import ProductList from '@/components/product/productlist'
import CollectionList from '@/components/product/collectionlist'
import BussinessInfo from '@/components/product/bussiness_info'

import Seat from '@/components/util/seat'
import BankcardList from '@/components/account/bankcardlist'
import Bankcard from '@/components/account/bankcard'
import AddressList from '@/components/user/addresslist'
import Address from '@/components/user/address'

import HelpSeller from '@/components/help/seller'


import FxOrderList from '@/components/mine/fxorderlist'
import FxOrderSearch from '@/components/mine/fxordersearch'


import Activation from '@/components/activation/index'


import Poster from '@/components/util/poster'
import Invitation from '@/components/util/invitation'
import BindWX from '@/components/register/bindwx'
import BindSuccess from '@/components/register/success'


import DestroyLogin from '@/components/destroy/login'
import DestroyMain from '@/components/destroy/main'
import DestroyStatistics from '@/components/destroy/statistics'



import ToolMain from '@/components/tool/index'
import ToolMine from '@/components/tool/mine'





import Touch from '@/components/util/touch'

import Test from '@/components/Test'



Vue.use(Router)


var router =  new Router({

    scrollBehavior (to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition
        } else {
            return { x: 0, y: 0 }
        }
    },

  routes: [

    // { 
    //   path: '/', 
    //   redirect: '/home',
    // },


    {
        path : '/dlq', component : Main,
        children : [
            {
                name: 'hometoolmain',
                path: 'hometoolmain',
                component: ToolMain,
                meta: {
                  title:"工具11",
                }
            },
        ]
    },


    { path: '/', component: Main,
      children: [
        {
            name : 'home',
            path: 'home',
            component: Home,
            meta: {
              title:"首页",
              keepAlive : true,
            }
        },
        
        {
            name: 'mine',
            path: 'mine',
            component: Mine,
            meta: {
              title:"我的",
            }
        },

        {
            name: 'orderlist',
            path: 'orderlist',
            component: OrderList,
            meta: {
              title:"订单列表",
            }
        },


        {
            name: 'hometoolmain',
            path: 'hometoolmain',
            component: ToolMain,
            meta: {
              title:"工具11",
            }
        },


      ],
      
    },

    {
      name: 'test',
      path: '/t',
      component: Test
    },

    {
      name: 'goods',
      path: '/goods',
      component: Goods,
      meta: {
        title:"货架",
        //keepAlive : true,
      }
      
    },

    {
        name: 'account',
        path: '/account',
        component: Account,
        meta: {
          title:"账户",
        }
    },

    {
        name: 'cash',
        path: '/cash',
        component: Cash,
        meta: {
            requiresCashAuth : true,
            title:"提现",
        }
    },

    {
        name: 'cashsuccess',
        path: '/cashsuccess',
        component: Cashsuccess,
        meta: {
          title:"提现成功",
        }
    },

    {
        name: 'profitlist',
        path: '/profitlist/:what',
        component: ProfitList,
        meta: {
          title:"收入列表",
        }
    },

    {
        name: 'profitinfo',
        path: '/profitinfo',
        component: ProfitInfo,
        meta: {
          title:"收入详情",
        }
    },


    {
        name: 'cashloglist',
        path: '/cashloglist',
        component: CashLogList,
        meta: {
          title:"提现明细",
        }
    },


    

    {
        name: 'orderinfo',
        path: '/orderinfo/:code',
        component: OrderInfo,
        meta: {
          title:"订单详情",
        }
    },
    {
        name: 'orderinfosms',
        path: '/o/:code',
        component: OrderInfoSms,
        meta: {
          title:"订单详情",
        }
    },


    {
        name: 'productinfo',
        path: '/product/:code',
        component: ProductInfo,
        meta: {
          title:"产品详情",
        }
    },


    {
        name: 'makeorder',
        path: '/order',
        component: MakeOrder,
        meta: {
            requiresAuth : true,
            title : '确认下单',
        }
    },


    {
        name: 'paysuccess',
        path: '/paysuccess',
        component: Paysuccess,
        meta: {
          title:"支付成功",
        }
    },


    {
        name: 'applyseller',
        path: '/applyseller',
        component: ApplySeller,
        meta: {
          title:"申请分销商",
        }
    },


    {
        name: 'fanslist',
        path: '/fanslist',
        component: FansList,
        meta: {
          title:"粉丝列表",
        }
    },

    {
        name: 'sellerlist',
        path: '/sellerlist',
        component: SellerList,
        meta: {
          title:"分销商列表",
        }
    },


    {
        name: 'statistics',
        path: '/statistics',
        component: Statistics,
        meta: {
          title:"销售统计",
        }
    },


    {
        name: 'statisticsseller',
        path: '/statisticsseller',
        component: StatisticsSeller,
        meta: {
          title:"分销商销售统计",
        }
    },


    {
        name: 'goodsforcustomer',
        path: '/goodsforcustomer',
        component: Goodsforcustomer,
        meta: {
          title:"产品列表",
          //keepAlive : true,
        }
    },

    {
        name: 'productlist',
        path: '/productlist',
        component: ProductList,
        meta: {
          title:"产品列表",
          //keepAlive : true,
        }
    },

    {
        name: 'collectionlist',
        path: '/collectionlist',
        component: CollectionList,
        meta: {
          title:"收藏列表",
        }
    },

    {
        name: 'fxorderlist',
        path: '/fxorderlist',
        component: FxOrderList,
        meta: {
          title:"分销订单",
        }
    },

    {
        name: 'fxordersearch',
        path: '/fxordersearch',
        component: FxOrderSearch,
        meta: {
          title:"分销查询",
        }
    },


    {
        name: 'activation',
        path: '/activation',
        component: Activation,
        meta: {
          title:"激活",
        }
    },


    

    // {
    //   name: 'bussinessinfo',
    //   path: '/bussinessinfo',
    //   component: BussinessInfo
    // },
    {
        name: 'seat',
        path: '/seat',
        component: Seat,
        meta: {
          title:"选座",
        }
    },

    {
        name: 'bankcardlist',
        path: '/bankcardlist',
        component: BankcardList,
        meta: {
          title:"银行卡",
        }
    },

    {
        name: 'bankcard',
        path: '/bankcard',
        component: Bankcard,
        meta: {
          title:"添加银行卡",
        }
    },

    {
        name: 'addresslist',
        path: '/addresslist',
        component: AddressList,
        meta: {
          title:"我的收货地址",
        }
    },

    {
        name: 'address',
        path: '/address',
        component: Address,
        meta: {
          title:"编辑收货地址",
        }
    },

    {
        name: 'helpseller',
        path: '/helpseller',
        component: HelpSeller,
        meta: {
          title:"群盟帮助",
        }
    },

    {
        name: 'touch',
        path: '/touch',
        component: Touch,
        meta: {
          title:"测试滑动",
        }
    },


    {
        name: 'poster',
        path: '/poster',
        component: Poster,
        meta: {
          title:"测试海报",
        }
    },

    {
        name: 'invitation',
        path: '/invitation',
        component: Invitation,
        meta: {
          title:"测试邀请函",
        }
    },

    {
        name: 'bindwx',
        path: '/bindwx',
        component: BindWX,
        meta: {
          title:"绑定微信",
        }
    },

    {
        name: 'bindsuccess',
        path: '/bindsuccess',
        component: BindSuccess,
        meta: {
          title:"绑定微信",
        }
    },

    {
        name: 'destroylogin',
        path: '/destroy/login.html',
        component: DestroyLogin,
        meta: {
          title:"设备登录",
        }
    },

    {
        name: 'destroymain',
        path: '/destroymain.html',
        component: DestroyMain,
        meta: {
          title:"核销",
        }
    },

    {
        name: 'destroystatistics',
        path: '/destroystatistics/:devicecode',
        component: DestroyStatistics,
        meta: {
          title:"核销统计",
        }
    },


    {
        name: 'toolmain',
        path: '/tool/main',
        component: ToolMain,
        meta: {
          title:"工具",
        }
    },

    {
        name: 'toolmine',
        path: '/tool/mine',
        component: ToolMine,
        meta: {
          title:"工具-我的",
        }
    },


  ]
});





export default router;
